class Alarm < ActiveRecord::Base
  STATUS_MAP = { 0 => "OK"  ,
            1 => "WARNING",
            2 => "CRITICAL",
            3 => "UNKNOWN" }

  def elapsed
    last_check - duration
  end
  
  def status_s
    return STATUS_MAP[status]
  end
end